#ifndef __UNIT_MANAGER_H__
#define __UNIT_MANAGER_H__
#include "gofgame/dungeonkeeper/game/unit/AllUnit.h"
#include "gofgame/dungeonkeeper/game/Icon.h"
#include "gofgame/dungeonkeeper/game/GoldManager.h"
#include <vector>

using namespace gofgame::dungeonkeeper::game::unit;

namespace gofgame {
	namespace dungeonkeeper {
		namespace game {
			namespace unit {
				const int MY_UNIT = 0;
				const int AI_UNIT = 1;


				struct UnitElementViewInfo {
					std::string imagePath;
					std::string name;
					int hp;
					int mp;
					int attack;
					int def;
					int speed;
					int attackSpeed;
					int price;
					int id;
					std::string desc;
					int lv;
				};

				class UnitManager {
				public:
					static Unit * create(int id,int lv,int type);
					CCPoint aiUnitSpawn();
					static IconInfo getIconInfo(int id);
					static bool costCheck(int id);
					static bool useCost(int id);
					static UnitType getUnittypeByLevel(int id,int lv);
					static void initUnitAnimate(Unit *unit);
					static UnitElementViewInfo getUnitElementViewInfo(int id,int lv);
					static void fillVectorById(std::vector<int> &v);
					static void createAllUnit();
				};
			}
		}
	}
}

#endif //__UNIT_MANAGER_H__
